package cn.strategy.fund;

import org.junit.Test;

import java.util.List;

public class TypeFind_case {

    @Test
    public void type_fund_case1() {
        List<List<Object>> lst = Inflow_type.inflow();
        int i = 1;
        for (List<Object> r : lst) {
            List<String> rs = Inflow_stock_1.inflow(r.get(0).toString(), "2025-05-30");
            System.out.println(i + " " + r.get(0).toString() + " " + rs);
            i++;
        }
    }

    @Test
    public void stock_inflow_case1() {
        Double all = 0D;
        Double result = 0D;
        String last_day = "2025-05-14";
        List<List<Object>> lst = Inflow_type.inflow();
        for (int i = 1; i < 6; i++) {
            List<Object> r = lst.get(i);
            List<String> rs = Inflow_stock_1.inflow(r.get(0).toString(), last_day);
            for (String name : rs) {
                Double end = Inflow_stock.getStockPrice(name, "2025-05-15");
                Double begin = Inflow_stock.getStockPrice(name, last_day);
                result += 100 * (end - begin);
                all += 100 * begin;
            }
        }
        System.out.println("总共花费：" + all + " 盈亏：" + result);
        System.out.println("涨跌："+ (result / all) * 100 +"%");
    }

    @Test
    public void stock_inflow_case2() {

        System.out.println(1736360 - 798447 - 111173 - 822156);
    }
}





































